package net.zdreamer.geracomium.adapter;

import android.content.Context;
import android.content.Intent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.example.geracomium.R;

import net.zdreamer.geracomium.entity.IndentListInfos.IndentListInfo;
import net.zdreamer.geracomium.ui.more.FoodIndentActivity;
import net.zdreamer.geracomium.utils.tools_utils.ViewHolder;

import java.util.List;

/**
 * Created by qiang on 2014/11/21.
 */

public class IndentListAdapter extends MyBaseAdapter<IndentListInfo> {
    public IndentListAdapter(Context context, List<IndentListInfo> list, int res) {
        super(context, list, res);
    }

    @Override
    protected View getView(int position, View convertView, ViewGroup parent, IndentListInfo value) {
        TextView indent = ViewHolder.get(convertView, R.id.indentname);
        indent.setText(value.indent);
        convertView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent=new Intent(getmContext(), FoodIndentActivity.class);
                        getmContext().startActivity(intent);
            }
        });
        return convertView;
    }
}
